﻿#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.Diagnostics;
using System.IO;
#endregion Using Statements

namespace CakeRaid
{
    class Trap_Flypaper : Trap
    {
        #region Constructor
        public Trap_Flypaper(ImageObject io, int health, int damage, int cost)
            : base(io, health, damage, cost)
        {
            type = Var.TrapType.Flypaper;
        }
        #endregion Constructor

        #region Methods
        public override void Activate(Vector2 enemyCenter)
        {
            if (IsActive && ((this.Width / 2) >= Vector2.Distance(enemyCenter, Center)))
            {
                canHit = true;
                healthBar.Show(time);
                CurrentHealth--;
            }
        }
        #endregion Methods

        #region Draw
        public override void Draw(GameTime gameTime)
        {
            if (IsActive)
            {
                base.Draw(gameTime, Var.FRAME_SPEED, 2);
                healthBar.Draw();
            }
        }
        #endregion Draw
    }
}